package com.ctshk.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * @author 胡广
 * @description 销售方式枚举
 * @date 2021/3/11
 */
@AllArgsConstructor
public enum SalesMethod {

    SINGLE_SALE(1, "单品销售"), // 自由行单项
    PACKAGE_SALE(2, "打包销售"), // 自由行套票
    PACKAGE_TICKET(3, "套票"), // 固定套票
    ;

    @Getter
    @Setter
    private int code;

    @Getter
    @Setter
    private String value;

    public static String parseValue(int code) {
        for (SalesMethod type : SalesMethod.values()) {
            if (type.code == code) {
                return type.getValue();
            }
        }
        return null;
    }

}
